کد:این برنامه در مورد قواعد پاسکال بیان کرده است: program ! program id ( identifier list ) ; declarations subprogram declarations compound statement . identifier list ! id j identifier list , id declarations ! declarations var identifier list : type ; j ² type ! standard type j array [ num .. num ] of standard type standard type ! integer j real subprogram declarations ! subprogram declarations subprogram declarion ; j ² subprogram declaration ! subprogram head declarations compound statement subprogram head ! function id arguments : standard type ; j procedure id arguments ; arguments ! ( parameter list ) j ² parameter list ! identifier list : type j parameter list ; identifier list : type compound statement ! begin optional statements end 1optional statements ! statement list j ² statement list ! statement j statement list ; statement statement ! variable assignop expression j procedure statement j compound statement j if expression then statement else statement j while expression do statement variable ! id j id [ expression ] procedure statement ! id j id ( expression list ) expression list ! expression j expression list , expression expression ! simple expression j simple expression relop simple expression simple expression ! term j sign term j simple expression addop term term ! factor j term mulop factor factor ! id j id ( expression list ) j num j ( expression ) j not factor sign ! + j ¡ 2
موضوعات مشابه:
علاقه مندی ها (Bookmarks)